package com.example.lenovo.demo;


import android.app.ProgressDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import android.util.Log;
import android.widget.ListView;

import com.example.lenovo.demo.presenter.CityActivityPresenter;
import com.example.lenovo.demo.view.ifgview.ICityActivity;

public class CityActivity extends AppCompatActivity{
    private ListView listView;
    private String id;
    private ProgressDialog progressDialog;

    private ICityActivity iCityActivity;
    @Override
    protected void onCreate(Bundle savedInstanceState)  {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_city);
        initData();
        initView();
        CityActivityPresenter cityActivityPresenter=new CityActivityPresenter();
        iCityActivity=cityActivityPresenter;
        iCityActivity.sendView(this,listView,id,progressDialog);
        cityActivityPresenter.init();

    }

    private void initData() {
        Bundle bundle=getIntent().getExtras();
        id=bundle.getString("id");
    }


    private void initView() {
        listView= (ListView) findViewById(R.id.activity_city_lv);
        progressDialog=new ProgressDialog(this);
        progressDialog.setTitle("提示");
        progressDialog.setMessage("正在加载...");
        progressDialog.setCancelable(true);
    }

}
